On the chessboard of size
(
) we put
rooks.
The arrangement of the rooks should satisfy the following rules:
, the
-th rook can be put on the rectangle specified by two pairs of
coordinates:
,
, where
) are coordinates of the square in the
left upper corner of the rectangle (row, column),
) are coordinates of the square in
the right lower corner of the rectangle,
and
.
A field in the left upper square has coordinates
,
a square in the right lower corner has coordinates
.
Write a program which:
and for each
the coordinates of the rectangle, in which the
-th rook can be put,
In the first line of the standard input there is written one positive integer
,
.
In each of the following
lines there are written four positive integers not grater than
separated by single spaces.
The numbers in the
-th line are the coordinates of the rectangle, in which the
-th rook may be put (
,
,
and
respectively).
In the standard output there should be written one word NIE,
or in each of
lines of the output file there should be written two integers separated by a single space.
The numbers in the
-th line should denote the position of
-th rook (row, column).
This position should be within the rectangle specified by coordinates in the
-th line of the input.
Pay attention to the fact that the positions of the rooks should be written in the same order as the coordinates of the rectangles were read from the input.
For the input data:
4 1 1 1 1 1 3 2 4 3 1 4 2 2 2 4 4
the correct result is:
1 1 2 3 3 2 4 4
Task author: Krzysztof Diks.
W razie problemów technicznych ze Szkopułem, prosimy o kontakt mailowy pod adresem szkopul@fri.edu.pl.
Jeśli chciałbyś porozmawiać o zadaniach, rozwiązaniach lub problemach technicznych, odwiedź nasze serwery na Discordzie. Są one moderowane przez społeczność, ale członkowie zespołu wsparcia również aktywnie się tam udzielają.